<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>

<html-el:form action="/cadastroTurma.do">
	<html-el:hidden property="method" styleId="method"/> 
		<table border="0">
			<tr>
				<td class="subDetails" width="100%">
					<table class="details" cellspacing="1" cellpadding="0" style="width:100%">
						<tr>
							<td class="labelDialog" style="width:90px">Data Início:</td>
							<td class="valueDialog">
								<bean:write name="turmaDetalhe" property="inicio" format="dd/MM/yyyy"/>
							</td>
							<td class="labelDialog" style="width:110px">Data Término:</td>
							<td class="valueDialog">
								<bean:write name="turmaDetalhe" property="termino" format="dd/MM/yyyy"/>
							</td>
						</tr>
						<tr>
							<td class="labelDialog">Curso:</td>
							<td class="valueDialog">${turmaDetalhe.curso.nome}</td>
							<td class="labelDialog">Período:</td>
							<td class="valueDialog">${turmaDetalhe.periodo.descricao}</td>
						</tr>
						<tr>
							<td class="labelDialog">Sala:</td>
							<td class="valueDialog">${turmaDetalhe.sala.descricao}</td>
							<td class="labelDialog">Vagas:</td>
							<td class="valueDialog">${turmaDetalhe.vagas}</td>
						</tr>
						<logic-el:present name="emitirTermoCredenciamentoTaxi" scope="request">
							<tr>
								<td class="labelDialog">Turma DTP:</td>
								<td class="valueDialog">${turmaDetalhe.codigoTaxi}</td>
							</tr>
						</logic-el:present>
					</table>
									
				</td>
			</tr>
		<tr>
			<td>				
				<div class="content">
					<table class="con">
						<tr>
							<td>
								<table class="breadory">
									<tr>
										<td>Lista de Alunos</td>
									</tr>
								</table>
							
								<table style="width:750px;height:300px">
									<tr>
										<td valign="top">
											<table style="width: 100%" class="tbDadosConsulta">
												<tr>
													<th style="width:25px"></th>
													<th>Nome</th>
													<th style="width:120px">CPF</th>
													<logic:equal name="turmaDetalhe" property="encerrado" value="true">
														<th>Avaliação</th>
													</logic:equal>
												</tr>
												<logic-el:iterate id="bean" name="turmaDetalhe" property="matriculas" indexId="i">
												<tr class="linha${i%2}">
													<td style="text-align: center">
														<logic:greaterThan name="bean" property="ordemServico.devedor" value="0">
															<a href="javascript:carregaEfetuarPagamento('matricula', ${bean.codigo})">
																<img src="_images/attention.gif" border="0" title="<bean:write name="bean" property="ordemServico.devedor" format="###,##0.00" locale="defaultLocale"/>"/>
															</a>
														</logic:greaterThan>
														<logic:empty name="bean" property="ordemServico.devedor">
															<img src="_images/status-ok.png" border="0"/>
														</logic:empty>
													</td>
													<td style="text-align: left">${bean.aluno.nome}</td>
													<td style="text-align: center">
														<a href="#" onclick="window.location = 'consultarAluno.do?method=iniciar&aluno=${bean.aluno.codigo}'">${bean.aluno.cpf}</a>
													</td>
													
													<logic:equal name="turmaDetalhe" property="encerrado" value="true">
														<logic:equal name="turmaDetalhe" property="ultimoDia" value="true">
															<td style="text-align: center; width: 200px">
																<app:comboMotivoAprovacao styleId="motivoAprovacao" title="Motivo de Aprovação" style="width:250px" onchange="atualizaAvaliacao(this, ${bean.codigo})" selected="${bean.avaliacao.codigo}"/>
															</td>
														</logic:equal>
														<logic:equal name="turmaDetalhe" property="ultimoDia" value="false">
															<td style="text-align: left">${bean.avaliacao.descricao}</td>
														</logic:equal>
														</td>
													</logic:equal>
												</tr>
												</logic-el:iterate>	
												<input type="hidden" name="turmaDetalheMatricula" value=""/>	
											</table>
										</td>
									</tr>
								</table>							
							</td>
						</tr>						
					</table>	
				</div>
			</td>
		</tr>
		<tr>
			<td class="buttons" align="right" valign="bottom">
				<logic-el:present name="emitirTermoCredenciamentoTaxi" scope="request">
					<a href="javascript:gerarCertificados(${turmaDetalhe.codigo})" class="button">
						<span title="Geração dos Certificados">Certificados</span>
					</a>
					<a href="javascript:gerarTermoCredenciamentoTaxi(${turmaDetalhe.codigo})" class="button">
						<span title="Geração do Termo de Credenciamento do Curso de Taxi">Termo de Credenciamento</span>
					</a>
					<a href="javascript:gerarRelacaoAlunosTaxi(${turmaDetalhe.codigo})" class="button">
						<span title="Download do Arquivo com a Relação de Alunos do Curso de Taxi">Relação de Alunos</span>
					</a>
				</logic-el:present>
				<a href="javascript:detalheCancelar()" class="button">
					<span>Fechar</span>
				</a>
			</td>
		</tr>
	</table>
</html-el:form>